package com.example.natatorium_management.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.natatorium_management.entity.MemberShip;
import com.example.natatorium_management.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MemberShipMapper extends BaseMapper<MemberShip> {
    int addMemberShip(MemberShip memberShip);

    IPage<MemberShip> queryPage(IPage<MemberShip> page);

    int updateMemberShip(MemberShip memberShip);
    MemberShip findMemberShipById(int memberShipId);

    IPage<MemberShip> findMemberShipByName(IPage<MemberShip> page, @Param("customerName")String customerName);

    IPage<MemberShip> findMemberShipByPhone(IPage<MemberShip> page, @Param("phone")Long phone);

    IPage<MemberShip> findMemberShipByCard(IPage<MemberShip> page, @Param("card")Long card);

    IPage<MemberShip> findMemberShipByNameAndPhone(IPage<MemberShip> page, @Param("memberShip")MemberShip memberShip);

    IPage<MemberShip> findMemberShipByNameAndCard(IPage<MemberShip> page, @Param("memberShip")MemberShip memberShip);

    IPage<MemberShip> findMemberShipByCardAndPhone(IPage<MemberShip> page, @Param("memberShip")MemberShip memberShip);

    IPage<MemberShip> findMemberShipByCardAndPhoneAndName(IPage<MemberShip> page, @Param("memberShip")MemberShip memberShip);

    int deleteMemberShipById(int memberShipId);
}
